<?php
!function_exists('zeai_alone') && exit('Forbidden!');
require_once ZEAI.'m/div_left_so.php';
$nodatatips="<div class='nodatatips'><i class='ico'>&#xe608;</i>暂时木有符合条件的会员</div>";
$t=trimhtml(dataIO($t,'out'));
//
function rows_ulist2($rows,$p,$n=1) {
	global $db,$_ZEAI,$cook_uid,$cook_sex,$cook_grade,$zeai_cn,$t,$showtype;
	$uid       = $rows['id'];
	$uflag     = $rows['flag'];
	$sex       = $rows['sex'];
	$grade     = $rows['grade'];
	$photo_s   = $rows['photo_s'];
	$photo_f   = $rows['photo_f'];
	$heigh     = $rows['heigh'];
	$weigh     = $rows['weigh'];
	$job       = $rows['job'];
	$love      = $rows['love'];
	$areatitle = $rows['areatitle'];
	$birthday  = $rows['birthday'];
	$nickname  = trimhtml(dataIO($rows['nickname'],'out'));
	$age = getage($rows['birthday']);
	$RZ  = $rows['RZ'];$RZarr = explode(',',$RZ);
	$pay = $rows['pay'];
	$edu = $rows['edu'];
	$hobby = $rows['hobby'];
	$photo_ifshow = $rows['photo_ifshow'];
	$mate = mate_echo($rows,'text');
	$aboutus = trimhtml(dataIO($rows['aboutus'],'out'));
	$marrytime = $rows['marrytime'];
	$smb=($showtype==3)?'b':'m';
	$photo_m_url  = photo_s_out('{"smb":"'.$smb.'","sex":"'.$sex.'","photo_s":"'.$photo_s.'","photo_f":"'.$photo_f.'","photo_ifshow":"'.$photo_ifshow.'","uflag":"'.$uflag.'","outkind":"url"}');
	$photo_s_flag = photo_s_out('{"smb":"'.$smb.'","sex":"'.$sex.'","photo_s":"'.$photo_s.'","photo_f":"'.$photo_f.'","photo_ifshow":"'.$photo_ifshow.'","uflag":"'.$uflag.'","outkind":"flag"}');
	$href=mHref('u',$uid);
	//topu start
	if($p=='top'){
		$toptime2 = $n;
		$addtime2=intval($toptime2[$uid]['addtime2']);
		if($addtime2<ADDTIME){
			$db->query("DELETE FROM ".__TBL_TOP_U__." WHERE uid=".$uid);
			$C = $nickname.'您好，您的置顶时间已过期~~，排名已下架，为了避免你与另一半擦肩而过，建议你尽快续费重新置顶　<a href="'.HOST.'/m/my_top.php'.'" class=aQING>立即置顶</a>';
			$db->SendTip($uid,'您的置顶时间已过期，请速重新置顶',dataIO($C,'in'),'sys');
			if (!empty($openid) && $subscribe==1){
				$first     = urlencode($nickname.',您的置顶时间已过期！');
				$keyword1  = urlencode('排名已下架');
				$keyword3  = urlencode('系统自动执行');
				$remark    = urlencode('为了避免你与另一半擦肩而过，建议你尽快续费重新置顶');
				@wx_mb_sent('mbbh=ZEAI_ADMIN_INFO&openid='.$openid.'&keyword1='.$keyword1.'&keyword3='.$keyword3.'&time='.ADDTIME.'&first='.$first.'&remark='.$remark.'&url='.urlencode(HOST.'/m/my_top.php'));
			}
		}
		$topuico = '<div class="topuico">推荐</div>';
	}else{
		$topuico = '';
	}
	//topu end
	if($showtype==2){//列表
		$unifo1='';
		if(!empty($areatitle)){
			$aARR = explode(' ',$areatitle);
			$A2 = $aARR[1];
			$A3 = $aARR[2];
			if(!empty($A2) || !empty($A3))$unifo1 = $A2.$A3.'　';
		}
		$unifo1 .= ($age<=0)?'':$age.'岁'.'　';
		$unifo1 .= (empty($love))?'':udata('love',$love).'　';
		$unifo1 .= (empty($heigh))?'':udata('heigh',$heigh).'　';
		//$unifo1 .= (empty($weigh))?'':udata('weigh',$weigh).'　';
		$unifo1 .= (empty($job))?'':udata('job',$job).'　';
		$unifo1 .= (empty($edu))?'':udata('edu',$edu).'　';
		$unifo1 .= (empty($pay))?'':udata('pay',$pay).'　';
		$unifo1  = rtrim($unifo1,'　');
		$hobby = (empty($hobby))?'':udata('hobby',$hobby);
		if(!empty($hobby)){
			$hobbyARR = explode(',',$hobby);
			if (count($hobbyARR) >= 1 && is_array($hobbyARR)){
				foreach ($hobbyARR as $v) {$uinfo2 .= '<li>'.$v.'</li>';}
			}
		}
		$uinfo2 = (!empty($uinfo2))?$uinfo2:'';
		if(empty($uinfo2)){
			$uinfo2 = (empty($marrytime))?'':'<li>期望'.udata('marrytime',$marrytime).'结婚</li>';	
		}
		if($t=='gps'){
			if(!empty($areatitle))$A_str='<b>'.$A2.'·'.$A3.'</b>';
			$distance = $rows['distance'];
			if ($distance<1000){
				$distance_str  = $distance.'m';
			}else{
				$distance_str  = number_format($distance/1000).'km';
			}
			$gps_str='<span class="zeaicolor gps"><i class="ico">&#xe624;</i> '.$distance_str.'</span>';
		}else{
			$gps_str='';
		}
		$em = (!empty($aboutus))?'<em><div>'.$aboutus.'</div></em>':'';
		//相册
		$pathlist = '';
		$rt2=$db->query("SELECT path_s FROM ".__TBL_PHOTO__." WHERE uid=".$uid." AND flag=1 ORDER BY id DESC LIMIT 3");
		$photo_total = $db->num_rows($rt2);
		if ($photo_total>0) {
			$pathlist = '<div class="pathlist">';
			for($i2=1;$i2<=$photo_total;$i2++) {
				$rows2 = $db->fetch_array($rt2,'num');
				if(!$rows2) break;
				$photo_flag = photo_s_out('{"sex":"'.$sex.'","photo_s":"'.$rows2[0].'","photo_f":"'.$photo_f.'","photo_ifshow":"'.$photo_ifshow.'","uflag":"'.$uflag.'","outkind":"flag"}');
				$photo_cls  = (!$photo_flag)?' class="blur"':'';
				$pathlist  .= '<img src="'.UP.$rows2[0].'"'.$photo_cls.'>';
			}
			$pathlist .= '</div>';
		}
		//输出
		$O  = '<a href="'.$href.'"><dl>';
		$O .= '<dt><img src="'.$photo_m_url.'" class="alpha0_100_1s">';
		$O .= ($grade>1)?'<img src="'.RES.'m/img/vipj.png?"'.$_ZEAI['cache_str'].' class="vipj">':'';
		$O .= '</dt>';
		$O .= '<dd><h4><span>'.$nickname.$topico.'</span>'.uicon($sex.$grade).'</h4>';//if (!empty($RZ))$O.= RZ_html($RZ,'s','color');
		$O .='<h6>'.$unifo1.'</h6><h5>'.$uinfo2.'</h5>';
		if (!empty($pathlist))$O .= $pathlist;
		$O .= '</dd>';
		if(in_array('photo',$RZarr) && $t!='cert_identity'){
			$O.= '<img src="'.RES.'m/img/rzj2.png?'.$_ZEAI['cache_str'].'" class="rzj">';
		}elseif(in_array('identity',$RZarr)){
			$O.= '<img src="'.RES.'m/img/rzj.png?'.$_ZEAI['cache_str'].'" class="rzj">';
		}
		$O .= $topuico;
		$O .= $gps_str.$em;
		if(in_array('store',$RZarr))$O.= '<img src="'.RES.'cert_store.png?'.$_ZEAI['cache_str'].'" class="cert_store">';
		if (!empty($mate))$O .= $zoyq_str = '<div class="zoyq"><li>寻觅</li>'.$mate.'</div>';
		$O .= '<div class="clear"></div></dl></a>';
	}elseif($showtype==3){//大图
		$aARR = explode(' ',$areatitle);$areatitle_str = (!empty($aARR[1]))?$aARR[1]:$aARR[0];
		if($t=='gps'){
			$distance = $rows['distance'];
			if ($distance<1000){
				$distance_str  = $distance.'m';
			}else{
				$distance_str  = number_format($distance/1000).'km';
			}
			$areatitle_str = (empty($areatitle_str))?'':'<i class="ico">&#xe624;</i> '.$distance_str;
			$marrytime = '<font>'.$aARR[1].' '.$aARR[2].' '.$aARR[3].'</font>';
		}else{
			$areatitle_str = (empty($areatitle_str))?'':'<i class="ico">&#xe624;</i>'.$areatitle_str.'';
			$marrytime = (empty($marrytime))?'':'<font>期望'.udata('marrytime',$marrytime).'结婚</font>';
		}
		$unifo='';
		$unifo .= ($age<=0)?'':'<li>'.$age.'岁</li>';
		$unifo .= (empty($heigh))?'':'<li>'.udata('heigh',$heigh).'</li>';
		$unifo .= (empty($edu))?'':'<li>'.udata('edu',$edu).'</li>';
		//$unifo .= (empty($job))?'':'<li>'.udata('job',$job).'</li>';
		$unifo .= (empty($pay))?'':'<li>'.udata('pay',$pay).'</li>';
		$O = '<a href="'.$href.'"><em><img class="alpha0_100_1s m" src="'.$photo_m_url.'">';
		$O .= ($grade>1)?'<img src="'.RES.'m/img/vipj.png?"'.$_ZEAI['cache_str'].' class="vipj">':'';
		$O .= '</em>';
		$O .= '<div class="uinfo">';
		$O .= '	<div class="nik"><span><h4>'.$nickname.'</h4>'.uicon($sex.$grade).'</span>'.$marrytime.'</div>';
		$O .= '	<div class="data"><span>'.$unifo.'</span><span>'.$areatitle_str.'</span></div>';
		$O .= '	<div class="about">'.$aboutus.'</div>';
		$O .= '</div>';
		if(in_array('photo',$RZarr) && $t!='cert_identity'){
			$O.= '<img src="'.RES.'m/img/rzj2.png?'.$_ZEAI['cache_str'].'" class="rzj">';
		}elseif(in_array('identity',$RZarr)){
			$O.= '<img src="'.RES.'m/img/rzj.png?'.$_ZEAI['cache_str'].'" class="rzj">';
		}
		$O .= $topuico;
		if (!empty($RZ))$O.= '<div class="payrz">'.RZ_html($RZ,'s','color').'</div>';
		$O.= '</a>';
	}else{//默认双排
		$age_str   = ($age>18)?$age.'岁':'';
		$edu_str   = (ifint($edu))?udata('edu',$edu):'';
		$heigh_str = (ifint($heigh))?' · '.udata('heigh',$heigh).' · ':'';
		$pay_str   = (ifint($pay))?'<b>'.udata('pay',$pay).'</b>':'';
		$job_str   = (ifint($job))?'<b>'.udata('job',$job).'</b>':$pay_str;
		$love_str  = (ifint($love))?'<b>'.udata('love',$love).'</b>':'';
		$A='';
		if(!empty($areatitle)){
			$A=explode(' ',$areatitle);$A1=$A[0];$A2=$A[1];$A3=$A[2];
			if(!empty($A2)){$A=$A2;}elseif(!empty($A1)){$A=$A1;}
		}
		$A_str = (!empty($A))?'<b><strong class="ico">&#xe624;</strong>'.$A.'</b>':$love_str;
		if($t=='gps'){
			if(!empty($areatitle))$A_str='<b>'.$A2.'·'.$A3.'</b>';
			$distance = $rows['distance'];
			if ($distance<1000){
				$distance_str  = $distance.'m';
			}else{
				$distance_str  = number_format($distance/1000).'km';
			}
			$job_str='<b class="ico">&#xe624; '.$distance_str.'</b>';
		}
		$O  = '<a href="'.$href.'"'.$vip_class.'><em><img class="alpha0_100_1s m" src="'.$photo_m_url.'" />';
		$O .= '<div class="nik">'.'<span>'.$nickname.'</span></div>';//.uicon($sex.$grade)
		$O .= ($grade>1)?'<img src="'.RES.'m/img/vipj.png?"'.$_ZEAI['cache_str'].' class="vipj">':'';
		$O .= '</em>';
		$O .= '<div class="uinfo">';
		$O.= '<div class="data"><span><font>'.$age_str.$heigh_str.$edu_str.'</font></span><span>'.$A_str.$job_str.'</span></div>';//'.uicon($sex.$grade).'
		$O .= '</div>';
		if(in_array('photo',$RZarr) && $t!='cert_identity'){
			$O.= '<img src="'.RES.'m/img/rzj2.png?'.$_ZEAI['cache_str'].'" class="rzj">';
		}elseif(in_array('identity',$RZarr)){
			$O.= '<img src="'.RES.'m/img/rzj.png?'.$_ZEAI['cache_str'].'" class="rzj">';
		}
		$O .= $topuico;
		$O.= '</a>';
		//if($n % 2 == 0)$O.= '<div class="clear"></div>';
	}
	return $O;
}
$_ZEAI['pagesize']= 8;
$fields    = "id,sex,grade,photo_s,photo_f,RZ,love,birthday,edu,pay,job,heigh,weigh,photo_ifshow,flag,areatitle,nickname,aboutus,marrytime,hobby";
$fields   .= ",mate_age1,mate_age2,mate_heigh1,mate_heigh2,mate_weigh1,mate_weigh2,mate_pay,mate_edu,mate_love,mate_car,mate_house,mate_areaid,mate_areatitle,mate_job,mate_child,mate_marrytime,mate_companykind,mate_smoking,mate_drink,mate_areaid2,mate_areatitle2,mate_other";
$ZEAI_SQL  = " flag=1 AND kind<>4 AND sex>0 AND nickname<>'' AND heigh>0 AND birthday<>'0000-00-00'".$agentSQL;
$ORDER     = " ORDER BY refresh_time DESC,id DESC ";
$ZEAI_SQL2 = " a.flag=1 AND a.kind<>4 AND a.sex>0 AND a.nickname<>'' AND a.heigh>0 AND a.birthday<>'0000-00-00'".$agentSQL2;
$fields2   = "a.id,a.sex,a.grade,a.nickname,a.photo_s,a.photo_f,a.RZ,a.birthday,a.edu,a.pay,a.job,a.heigh,a.weigh,a.photo_ifshow,a.areatitle,a.aboutus,a.marrytime";
if(ifint($cook_uid && !empty($cook_sex)) && $_INDEX['iModuleU']==1){
	if($cook_ifadm!=1){
		$ZEAI_SQL  .= ($cook_sex==2)?" AND sex=1 ":" AND sex=2 ";
		$ZEAI_SQL2 .= ($cook_sex==2)?" AND a.sex=1 ":" AND a.sex=2 ";
		$TOP_SQL    = ($cook_sex==2)?" AND sex=1 ":" AND sex=2 ";
	}
}
if($showtype==3){
	$ZEAI_SQL  .= " AND photo_s<>'' AND photo_f=1 ";
	$ZEAI_SQL2 .= " AND a.photo_s<>'' AND a.photo_f=1 ";
	$TOP_SQL   .= " AND photo_s<>'' AND photo_f=1 ";
}
//topu
$topUarr = topUarrFn();
if(!empty($topUarr)){
	$topuidlist = $topUarr['uidlist'];
	$toptime2   = $topUarr['toptime2'];
	if(!empty($topuidlist)){
		$ZEAI_SQL  .= " AND id NOT IN ($topuidlist) ";
		$ZEAI_SQL2 .= " AND a.id NOT IN ($topuidlist) ";
	}
}
//topu end
switch ($t) {
	case 'match':
		$row = $db->ROW(__TBL_USER__,"mate_age1,mate_age2,mate_heigh1,mate_heigh2,mate_weigh1,mate_weigh2,mate_pay,mate_edu,mate_love,mate_car,mate_house,mate_areaid,mate_job,mate_child,mate_marrytime,mate_companykind,mate_smoking,mate_drink,mate_areaid2","(flag=1 OR flag=-2) AND id=".$cook_uid,"name");
		if (!$row)zeaialert('{"title":"亲，暂时木有符合你择偶要求的会员","btnt":"我知道了","url":"-1"}');
		$mate_age1      = intval($row['mate_age1']);
		$mate_age2      = intval($row['mate_age2']);
		$mate_heigh1    = intval($row['mate_heigh1']);
		$mate_heigh2    = intval($row['mate_heigh2']);
		$mate_pay       = $row['mate_pay'];
		$mate_edu       = $row['mate_edu'];
		$mate_areaid    = $row['mate_areaid'];
		$mate_love      = $row['mate_love'];
		$mate_car       = $row['mate_car'];
		$mate_house     = $row['mate_house'];
		//
		$mate_weigh1      = intval($row['mate_weigh1']);
		$mate_weigh2      = intval($row['mate_weigh2']);
		$mate_job         = $row['mate_job'];
		$mate_child       = $row['mate_child'];
		$mate_marrytime   = $row['mate_marrytime'];
		$mate_companykind = $row['mate_companykind'];
		$mate_smoking     = $row['mate_smoking'];
		$mate_drink       = $row['mate_drink'];
		$mate_areaid2     = $row['mate_areaid2'];
		//生成SQL语句
		$ZEAI_SQL .= " AND id<>".$cook_uid;
		$ZEAI_SQL .= mate_diy_SQL();
		if($cook_ifadm!=1)$ZEAI_SQL .= ($cook_sex == 2)?" AND sex=1 ":" AND sex=2 ";
		$ZEAI_SELECT = "SELECT ".$fields." FROM ".__TBL_USER__." WHERE ".$ZEAI_SQL.$ORDER;
		$TP=getTP($ZEAI_SQL);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];
	break;
	case 'gps':
		if(!iflogin())header("Location: ".mHref('login'));
		$row = $db->ROW(__TBL_USER__,"latitude,longitude,areatitle","latitude<>'' AND longitude<>'' AND id=".$cook_uid,"num");
		if (!$row){
			//zeaialert('{"title":"亲，请用【微信】访问并开启手机GPS定位后并同意授权，再点击【附近】按钮","btnt":"我知道了","url":"-1"}');
			header("Location: ".HOST."/m/map_set.php?kind=u&showtype=$showtype&areatitle=$cook_areatitle");
		}
		$data_latitude = $row[0];
		$data_longitude= $row[1];
		$ZEAI_SQL   .= " AND longitude<>'' ";
		$ZEAI_SELECT = "SELECT $fields,ROUND(6378.138*2*ASIN(SQRT(POW(SIN((".$data_latitude."*PI()/180-latitude*PI()/180)/2),2)+COS(".$data_latitude."*PI()/180)*COS(latitude*PI()/180)*POW(SIN((".$data_longitude."*PI()/180-longitude*PI()/180)/2),2)))*1000) AS distance FROM ".__TBL_USER__." WHERE ".$ZEAI_SQL." ORDER BY distance,id DESC";
		$TP=getTP($ZEAI_SQL);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];
	break;
	case 'sex':
		$sex=intval($sex);
		$ZEAI_SQL .= " AND sex=$sex ";
		$ZEAI_SELECT="SELECT $fields FROM ".__TBL_USER__." WHERE ".$ZEAI_SQL.$ORDER;
		$TP=getTP($ZEAI_SQL);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];
		$par = "&sex=".$sex;
	break;
	case 'vip':$mt = 'VIP会员';
		$ZEAI_SQL   .= "AND grade>1 ";
		$ZEAI_SELECT="SELECT ".$fields." FROM ".__TBL_USER__." WHERE ".$ZEAI_SQL." ORDER BY grade DESC,refresh_time DESC,id DESC";
		$TP=getTP($ZEAI_SQL);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];
	break;
	case 'new':$mt ='最新加入';
		$ZEAI_SELECT="SELECT ".$fields." FROM ".__TBL_USER__." WHERE ".$ZEAI_SQL." ORDER BY id DESC";
		$TP=getTP($ZEAI_SQL);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];
	break;
	case 'endtime':$mt='最近登录';
		$ZEAI_SELECT="SELECT ".$fields." FROM ".__TBL_USER__." WHERE ".$ZEAI_SQL." ORDER BY endtime DESC";
		$TP=getTP($ZEAI_SQL);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];
	break;
	case 'click':$mt='人气会员';
		$ZEAI_SQL  .= " AND click>0 ";
		$ZEAI_SELECT= "SELECT ".$fields." FROM ".__TBL_USER__." WHERE ".$ZEAI_SQL." ORDER BY click DESC,id DESC";
		$TP=getTP($ZEAI_SQL);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];
	break;
	case 'cert_identity':$mt='实名认证会员';
		$ZEAI_SELECT= "SELECT ".$fields." FROM ".__TBL_USER__." WHERE ".$ZEAI_SQL." AND FIND_IN_SET('identity',RZ) ".$ORDER;
		$TP=getTP($ZEAI_SQL);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];
	break;
	case 'cert_photo':$mt='真人认证会员';
		$ZEAI_SELECT= "SELECT ".$fields." FROM ".__TBL_USER__." WHERE ".$ZEAI_SQL." AND FIND_IN_SET('photo',RZ) ".$ORDER;
		$TP=getTP($ZEAI_SQL);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];
	break;
	case 'offline':$mt='线下会员';
		$ZEAI_SQL .= " AND (kind=2 OR kind=3) ";
		$sex=trimhtml(dataIO($sex,'out'));if(!empty($sex))$ZEAI_SQL .= doinsql('sex',$sex);
		$ZEAI_SELECT= "SELECT ".$fields." FROM ".__TBL_USER__." WHERE ".$ZEAI_SQL.$ORDER;
		$TP=getTP($ZEAI_SQL);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];
		$par = "&sex=".$sex;
	break;
	case 'fans':$mt='最有魅力';
		$ZEAI_SELECT= "SELECT ".$fields.",(SELECT COUNT(*) FROM ".__TBL_GZ__." WHERE uid=a.id AND flag=1 ) AS fansnum FROM ".__TBL_USER__." a WHERE ".$ZEAI_SQL." ORDER BY fansnum DESC,refresh_time DESC,id DESC";
		$TP=getTP($ZEAI_SQL);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];
	break;
	case 'keyword':
		if (!empty($keyword)){
			$keyword = trimhtml(dataIO($keyword,'out'));
			$ZEAI_SQL = "flag=1".$agentSQL;
			if (ifint($keyword)){
				$ZEAI_SQL .= " AND id='$keyword' ";
			}else{
				$ZEAI_SQL .= " AND nickname LIKE '%".$keyword."%' ";
			}
			$ZEAI_SELECT="SELECT $fields FROM ".__TBL_USER__." WHERE ".$ZEAI_SQL.$ORDER;
			$TP=getTP($ZEAI_SQL);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];
		}
	break;
	case 'ext':
		$keyword = trimhtml(dataIO($keyword,'out'));
		if (!empty($keyword)){
			$ZEAI_SQL = "flag=1".$agentSQL;
			if (ifint($keyword)){
				$ZEAI_SQL .= " AND id='$keyword' ";
			}else{
				$ZEAI_SQL .= " AND nickname LIKE '%".$keyword."%' ";
			}
		}else{
			$sex=trimhtml(dataIO($sex,'out'));if(!empty($sex))$ZEAI_SQL .= doinsql('sex',$sex);
			$photo_s=intval($photo_s);if ($photo_s == 1)$ZEAI_SQL .= " AND photo_s<>'' AND photo_f=1 ";
			$areaid=trimhtml(dataIO($areaid,'out'));
			$area2id=trimhtml(dataIO($area2id,'out'));
			$areaid=getareaSQL($areaid);
			$area2id=getareaSQL($area2id);
			if(!empty($areaid))$ZEAI_SQL .= " AND areaid LIKE '%".$areaid."%' ";
			if(!empty($area2id))$ZEAI_SQL .= " AND area2id LIKE '%".$area2id."%' ";
			//age
			$age=trimhtml(dataIO($age,'out'));
			if(!empty($age)){
				$V=explode(',',$age);
				$V1=intval($V[0]);$V2=intval($V[1]);
				if(ifint($V1))$ZEAI_SQL .= " AND ( (YEAR(CURDATE())-YEAR(birthday)-(RIGHT(CURDATE(),5)<RIGHT(birthday,5))) >= '$V1' ) ";
				if(ifint($V2))$ZEAI_SQL .= " AND ( (YEAR(CURDATE())-YEAR(birthday)-(RIGHT(CURDATE(),5)<RIGHT(birthday,5))) <= '$V2' ) ";
			}
			//heigh
			$heigh=trimhtml(dataIO($heigh,'out'));
			if(!empty($heigh)){
				$V=explode(',',$heigh);$V1=intval($V[0]);$V2=intval($V[1]);
				if (ifint($V1))$ZEAI_SQL .= " AND ( heigh >= '$V1' ) ";
				if (ifint($V2))$ZEAI_SQL .= " AND ( heigh <= '$V2' ) ";
			}
			//weigh
			$weigh=trimhtml(dataIO($weigh,'out'));
			if(!empty($weigh)){
				$V=explode(',',$weigh);$V1=intval($V[0]);$V2=intval($V[1]);
				if (ifint($V1))$ZEAI_SQL .= " AND ( weigh >= '$V1' ) ";
				if (ifint($V2))$ZEAI_SQL .= " AND ( weigh <= '$V2' ) ";
			}
			//edu
			$edu=intval($edu);if(!empty($edu))$ZEAI_SQL .= " AND ( edu >= '$edu' ) ";
			//pay
			$pay=intval($pay);if(!empty($pay))$ZEAI_SQL .= " AND ( pay >= '$pay' ) ";
			//job
			$job=trimhtml(dataIO($job,'out'));if(!empty($job))$ZEAI_SQL .= doinsql('job',$job);
			//love
			$love=trimhtml(dataIO($love,'out'));if(!empty($love))$ZEAI_SQL .= doinsql('love',$love);
			//child
			$child=trimhtml(dataIO($child,'out'));if(!empty($child))$ZEAI_SQL .= doinsql('child',$child);
			//house
			$house=trimhtml(dataIO($house,'out'));if(!empty($house))$ZEAI_SQL .= doinsql('house',$house);
			//nation
			$nation=trimhtml(dataIO($nation,'out'));if(!empty($nation))$ZEAI_SQL .= doinsql('nation',$nation);
			//car
			$car=trimhtml(dataIO($car,'out'));if(!empty($car))$ZEAI_SQL .= doinsql('car',$car);
			//marrytime
			$marrytime=trimhtml(dataIO($marrytime,'out'));if(ifint($marrytime))$ZEAI_SQL .= " AND marrytime='$marrytime' ";
			$par = "&sex=".$sex."&photo_s=".$photo_s."&areaid=".$areaid."&area2id=".$area2id."&age=".$age."&heigh=".$heigh."&weigh=".$weigh."&edu=".$edu."&pay=".$pay."&job=".$job."&love=".$love."&child=".$child."&house=".$house."&car=".$car."&marrytime=".$marrytime."&nation=".$nation;
		}
		$ZEAI_SELECT = "SELECT ".$fields." FROM ".__TBL_USER__." WHERE ".$ZEAI_SQL.$ORDER;
		$TP=getTP($ZEAI_SQL);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];
	break;
	default:
		$ZEAI_SQL .= " AND photo_s<>'' AND photo_f=1 ";
		$ZEAI_SELECT="SELECT $fields FROM ".__TBL_USER__." WHERE ".$ZEAI_SQL.$ORDER;
		$TP=getTP($ZEAI_SQL);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];
		//$photo_s=1;
	break;
}
$cs = "t=".$t."&showtype=".$showtype."&keyword=".$keyword.$par;
if($submitok=='ZEAI_list'){exit(Zeai_ajax_list_fn($ZEAI_totalP,$p,2));}
$FT=json_decode(FT,true);
$showstr1='<i class="ico">&#xe67a;</i>头像';
$showstr2='<i class="ico">&#xe65e;</i>列表';
$showstr3='<i class="ico">&#xe65f;</i>大图';
switch ($showtype) {
	case 2:$showcls = 'LIST_list';$showstr=$showstr2;break;
	case 3:$showcls = 'PIC_list';$showstr=$showstr3;break;
	default:$showcls= 'ZEAI_list';$showstr=$showstr1;break;
}
?>
<!doctype html><html><head><meta charset="utf-8">
<title><?php echo $_INDEX['indexTitle'];?></title>
<meta name="Keywords" content="<?php echo $_INDEX['indexKeywords'];?>">
<meta name="Description" content="<?php echo $_INDEX['indexContent'];?>">
<?php echo HEADMETA; ?>
<link href="<?php echo RES;?>m/css/m.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<link href="<?php echo HOST;?>/cache/zeaicolor.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<script src="<?php echo RES;?>www_zeai_cn.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>m/js/m.js?<?php echo ADDTIME;?>"></script>
<link rel="shortcut icon" href="<?php echo HOST;?>/favicon.ico" type="image/x-icon" />
<script>var browser='<?php echo browser();?>',showtype=<?php echo intval($showtype);?>,pagemore=<?php echo ($ZEAI_total > $_ZEAI['pagesize'])?'true':'false';?>;</script>
<script src="<?php echo HOST;?>/cache/areadata.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>m/js/zeai_div_area.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo HOST;?>/cache/udata.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>m/js/index2.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>zeai_ios_select/separate/select.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<meta name="generator" content="Zeai.cn V9" />
<?php if (is_weixin()){
	require_once ZEAI."api/weixin/jssdk.php";
	if(!empty($_INDEX['indexShareT'])){
		$shareT = dataIO($_INDEX['indexShareT'],'out');
		$shareC = dataIO($_INDEX['indexShareC'],'out');
		$shareP = UP.$_INDEX['indexShareP'];
	}else{
		$shareT = dataIO($_INDEX['indexTitle'],'out');
		$shareC = dataIO($_INDEX['indexContent'],'out');
		$shareP = UP.$_ZEAI['logo'];
	}?>
	<script src="<?php echo RES;?>jweixin-1.2.0.js"></script>
	<script>wx.config({debug:false,appId: '<?php echo $signPackage["appId"];?>',timestamp: <?php echo $signPackage["timestamp"];?>,nonceStr: '<?php echo $signPackage["nonceStr"];?>',signature: '<?php echo $signPackage["signature"];?>',jsApiList: ['hideMenuItems','onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ','onMenuShareWeibo']});
	var share_title = '<?php echo $shareT; ?>',
	share_desc  = '<?php echo $shareC; ?>',
	share_link  = '<?php echo HOST; ?>',
	share_imgUrl= '<?php echo $shareP; ?>?<?php echo $_ZEAI['cache_str'];?>';
	wx.ready(function () {
		wx.onMenuShareAppMessage({title:share_title,desc:share_desc,link:share_link,imgUrl:share_imgUrl});
		wx.onMenuShareTimeline({title:share_title,link:share_link,imgUrl:share_imgUrl});
	});
    </script>
<?php }?>
<link href="<?php echo RES;?>m/css/index2.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<style>
#backtop a{color:<?php echo $_ZEAI['mob_mbcolor'];?>}
.btmKefuBtn,.LIST_list dl .zoyq li{background-color:<?php echo $_ZEAI['mob_mbcolor'];?>;color:#fff}
#showtype_box a.ed,#showtype_box a.ed i{color:<?php echo $_ZEAI['mob_mbcolor'];?>}
.ZEAI_list a .uinfo .data span b,#sotab1 a.ed{background-color:rgba(<?php echo c16_rgb($_ZEAI['mob_mbcolor']);?>,.1);color:<?php echo $_ZEAI['mob_mbcolor'];?>;}
.ZEAI_list a em .nik{background:url("<?php echo RES;?>m/img/nikbg.png");background-size:100% 100%}
.LIST_list dl dd h5 li{background-color:rgba(<?php echo c16_rgb($_ZEAI['mob_mbcolor']);?>,.05);color:<?php echo $_ZEAI['mob_mbcolor'];?>;border-color:rgba(<?php echo c16_rgb($_ZEAI['mob_mbcolor']);?>,.1)}
/*div_left_so*/
.div_left_so a.ed,
.div_left_so a.ed:after{color:<?php echo $_ZEAI['mob_mbcolor'];?>}
.div_left_so ul.def li.ed{color:<?php echo $_ZEAI['mob_mbcolor'];?>;background-color:rgba(<?php echo c16_rgb($_ZEAI['mob_mbcolor']);?>,.1)}
.div_left_so .listbox dl dd span.ed{color:<?php echo $_ZEAI['mob_mbcolor'];?>;border-top-color:<?php echo $_ZEAI['mob_mbcolor'];?>}
.div_left_so_areabox .ul dt.ed{color:<?php echo $_ZEAI['mob_mbcolor'];?>;border-top-color:<?php echo $_ZEAI['mob_mbcolor'];?>}
.div_left_so_areabox .ul li a.ed{color:<?php echo $_ZEAI['mob_mbcolor'];?>;background-color:rgba(<?php echo c16_rgb($_ZEAI['mob_mbcolor']);?>,.1)}
.areabox .ul li a.ed{color:<?php echo $_ZEAI['mob_mbcolor'];?>;background-color:rgba(<?php echo c16_rgb($_ZEAI['mob_mbcolor']);?>,.1)}
.areabox .ul dt.ed,.listbox dl dd span.ed{color:<?php echo $_ZEAI['mob_mbcolor'];?>;border-top-color:<?php echo $_ZEAI['mob_mbcolor'];?>}
.ios-select-widget-box header.iosselect-header a.sure{background-color:<?php echo $_ZEAI['mob_mbcolor'];?>;}
/*bouncelogin*/
.bouncelogin a.size4{box-shadow:0 .3rem .8rem rgba(<?php echo c16_rgb($_ZEAI['mob_mbcolor']);?>,.4);background:-webkit-linear-gradient(315deg,rgba(<?php echo c16_rgb($_ZEAI['mob_mbcolor']);?>,.6) 0%,<?php echo $_ZEAI['mob_mbcolor'];?> 100%);background-color:#fff}
.bouncelogin em img{border-color:rgba(<?php echo c16_rgb($_ZEAI['mob_mbcolor']);?>,.2)}
.hdnav ul a.ed:after{background-color:<?php echo $_ZEAI['mob_mbcolor'];?>}
.sotab{box-shadow:0 .3rem .8rem rgba(<?php echo c16_rgb($_ZEAI['mob_mbcolor']);?>,.4);background:-webkit-linear-gradient(315deg,rgba(<?php echo c16_rgb($_ZEAI['mob_mbcolor']);?>,.6) 0%,<?php echo $_ZEAI['mob_mbcolor'];?> 100%);background-color:#fff}
</style>
</head>
<body>
<?php require_once ZEAI.'m/top2.php';?>
<div class="sotab" id="sotab">
    <li id="px"><span>排序</span><i class="ico">&#xe60b;</i></li>
    <li id="agebtn"><span>年龄</span><i class="ico">&#xe60b;</i></li>
    <li id="heighbtn"><span>身高</span><i class="ico">&#xe60b;</i></li>
    <li id="user_search"><span>更多</span><i class="ico">&#xe60b;</i></li>
</div>
<!--默认排序-->
<div class="soubox" id="sotab1">
	<a href="<?php echo SELF;?>?photo_s=1&t=ext&showtype=<?php echo $showtype;?>"<?php echo ($t == '' || $t == 'ext' || $t == 'diy')?' class="ed"':'';?>>默认排序</a>
	<a href="javascript:gpsbtnFn('<?php echo $cook_longitude;?>','<?php echo $cook_latitude;?>','<?php echo $cook_areatitle;?>');"<?php echo ($t == 'gps')?' class="ed"':'';?>><i class="ico">&#xe624;</i> 附近的</a>
	<a href="<?php echo SELF;?>?t=cert_identity&showtype=<?php echo $showtype;?>"<?php echo ($t == 'cert_identity')?' class="ed"':'';?>>实名认证</a>
	<a href="<?php echo SELF;?>?t=cert_photo&showtype=<?php echo $showtype;?>"<?php echo ($t == 'cert_photo')?' class="ed"':'';?>>真人认证</a>
	<a href="<?php echo SELF;?>?t=new&showtype=<?php echo $showtype;?>"<?php echo ($t == 'new')?' class="ed"':'';?>>最新加入</a>
	<a href="<?php echo SELF;?>?t=endtime&showtype=<?php echo $showtype;?>"<?php echo ($t == 'endtime')?' class="ed"':'';?>>最近登录</a>
	<a href="<?php echo SELF;?>?t=click&showtype=<?php echo $showtype;?>"<?php echo ($t == 'click')?' class="ed"':'';?>>人气最高</a>
	<a href="<?php echo SELF;?>?t=fans&showtype=<?php echo $showtype;?>"<?php echo ($t == 'fans')?' class="ed"':'';?>>最有魅力</a>
	<a href="<?php echo HOST;?>/m/izt.php">专区推荐<b>新</b></a>
</div>
<?php
if ($_INDEX['iMarquee'] == 1){?>
<div class="iMarqueeBox">
    <div id="iMarquee" class="iMarquee">
        <li><img src="<?php echo UP.$_ZEAI['logo'];?>?<?php echo $_ZEAI['cache_str'];?>"><font>欢迎来到<?php echo $_ZEAI['siteName'];?></font><i class="ico close" onClick="iMarqueeBox_off(this);">&#xe65b;</i></li>
    </div>
</div>
<script>setTimeout(function(){zeai_iMarqueeFn();},2000);</script>
<?php }?>
<!--div_left_so-->
<div id="rangebox"></div>
<div class="div_left_so" id="user_so">
	<form action="<?php echo SELF;?>" method="get" name="www.yzlove.com" id="ZEAI_CN_FORM_ext">
    	<div class="form_uid">
        <input name="keyword" type="text" class="input" id="keyword" maxlength="20" value="<?php echo $keyword;?>" placeholder="按会员UID/昵称" autocomplete="off">
        <button type="submit" class="ico">&#xe6c4;</button>
		</div>
        <?php
        if(ifint($cook_uid && !empty($cook_sex)) && $_INDEX['iModuleU']==2){
            div_left_so_out(array('tbody'=>$FT['sex']['t'],'t'=>'sex','tv'=>$sex,'subkind'=>3,'newarr'=>json_decode($_UDATA['sex']),'ulcls'=>' col3'));//性别
        }
        div_left_so_out(array('tbody'=>$FT['photo_s']['t'],'t'=>'photo_s','tv'=>$photo_s,'subkind'=>2,'newarr'=>json_decode('[{"i":"1","v":"有头像"}]'),'ulcls'=>' col3'));//头像
		//默认值
		function range_str($F,$V) {
			if(empty($V))return '';
			global $_UDATA;
			$FARR=explode(',',$V);
			$F1=$FARR[0];$F2=$FARR[1];
			$F_UDATA=json_decode($_UDATA[$V],true);
			$F_str = mateset_out($F1,$F2,$F_UDATA['dw']);
			$F_str = str_replace("不限","",$F_str);
			return $F_str;
		}		
        ?>
        <div class="listbox"><dl id="age" data="<?php echo (empty($age))?'23,24':$age;?>" class="rang"><dt>年龄范围</dt><dd><span><?php echo range_str('age',$age);?></span></dd></dl></div>
        <input type="hidden" id="form_age" name="age" value="<?php echo $age;?>">
        <div class="listbox"><dl id="heigh" data="<?php echo (empty($heigh))?'160,175':$heigh;?>" class="rang"><dt>身高范围</dt><dd><span><?php echo range_str('heigh',$heigh);?></span></dd></dl></div>
        <input type="hidden" id="form_heigh" name="heigh" value="<?php echo $heigh;?>">
        <div class="listbox"><dl id="weigh" data="<?php echo (empty($weigh))?'50,70':$weigh;?>" class="rang"><dt>体重范围</dt><dd><span><?php echo range_str('weigh',$weigh);?></span></dd></dl></div>
        <input type="hidden" id="form_weigh" name="weigh" value="<?php echo $weigh;?>">
        <!--地区-->
        <!--gz-->
        <div id="areabox" class="areabox"><div class="ul"><li><dl><dd></dd></dl></li></div></div>
        <input type="hidden" id="form_areaid" name="areaid" value="<?php echo $areaid;?>">
        <input type="hidden" id="form_areatitle" name="areatitle" value="<?php echo $areatitle;?>">
        <div class="listbox">
            <dl id="areaid" data="<?php echo $areaid;?>"><dt>工作地</dt><dd><span id="areatitle"><?php echo $areatitle;?></span></dd></dl>
        </div>
        <!--hj-->
        <div id="areabox2" class="areabox"><div class="ul"><li><dl><dd></dd></dl></li></div></div>
        <input type="hidden" id="form_area2id" name="area2id" value="<?php echo $area2id;?>">
        <input type="hidden" id="form_area2title" name="area2title" value="<?php echo $area2title;?>">
        <div class="listbox">
            <dl id="area2id" data="<?php echo $area2id;?>"><dt>户籍地</dt><dd><span id="area2title"><?php echo $area2title;?></span></dd></dl>
        </div>
        <input type="hidden" name="t" value="ext">
        <input type="hidden" name="showtype" value="<?php echo $showtype;?>">
        <!--地区结束-->
        <?php
        div_left_so_out(array('tbody'=>$FT['nation']['t'],'t'=>'nation','tv'=>$nation,'subkind'=>3,'newarr'=>json_decode($_UDATA['nation']),'ulcls'=>' col3','show'=>'off'));//民族
        div_left_so_out(array('tbody'=>$FT['love']['t'],'t'=>'love','tv'=>$love,'subkind'=>3,'newarr'=>json_decode($_UDATA['love']),'ulcls'=>' col3','show'=>'off'));//婚况
		?>
        <div class="listbox">
            <dl class="listdl_tips zeaicolor"><dt>以下仅对VIP会员开放</dt><dd><a href="<?php echo HOST;?>/m/my_vip.php?jumpurl=<?php echo HOST;?>"><i class="ico">&#xe611;</i>开通VIP</a></dd></dl>
        </div>
		<?php
		if(!ifint($cook_uid) || $cook_grade<2)echo '<div onclick="zeai.openurl(\''.mHref('vip').'\');return false">';
        div_left_so_out(array('tbody'=>$FT['child']['t'],'t'=>'child','tv'=>$child,'subkind'=>3,'newarr'=>json_decode($_UDATA['child']),'ulcls'=>' col3','show'=>'off'));//小孩
        div_left_so_out(array('tbody'=>'最低'.$FT['edu']['t'],'t'=>'edu','tv'=>$edu,'subkind'=>2,'newarr'=>json_decode($_UDATA['edu']),'ulcls'=>' col3','show'=>'off'));//学历
        div_left_so_out(array('tbody'=>'最低'.$FT['pay']['t'],'t'=>'pay','tv'=>$pay,'subkind'=>2,'newarr'=>json_decode($_UDATA['pay']),'ulcls'=>' col3','show'=>'off'));//收入
        div_left_so_out(array('tbody'=>$FT['job']['t'],'t'=>'job','tv'=>$job,'subkind'=>3,'newarr'=>json_decode($_UDATA['job']),'ulcls'=>' col3','show'=>'off'));//职业
        div_left_so_out(array('tbody'=>$FT['house']['t'],'t'=>'house','tv'=>$house,'subkind'=>3,'newarr'=>json_decode($_UDATA['house']),'ulcls'=>' col2','show'=>'off'));//房
        div_left_so_out(array('tbody'=>$FT['car']['t'],'t'=>'car','tv'=>$car,'subkind'=>3,'newarr'=>json_decode($_UDATA['car']),'ulcls'=>' col2','show'=>'off'));//车
        div_left_so_out(array('tbody'=>$FT['marrytime']['t'],'t'=>'marrytime','tv'=>$marrytime,'subkind'=>2,'newarr'=>json_decode($_UDATA['marrytime']),'ulcls'=>' col3','show'=>'off'));//结婚时间	
		if(!ifint($cook_uid) || $cook_grade<2)echo '</div>';
        ?>
        <script>div_left_so_init('user_so')</script>
        <div class="savebox"><button type="button" class="btn size3 reset" onClick="div_left_so_reset('user_so')">重置</button><button type="submit" class="btn size3 zeaibg ico">&#xe6c4; 确定</button></div>
    </form>
</div>
<!--div_left_so end-->
<div class="<?php echo $showcls;?>" id="ZEAI_list">
	<!--topu-->
	<?php
	if(!empty($topuidlist)){
		$rt=$db->query("SELECT ".$fields.",openid,subscribe FROM ".__TBL_USER__." WHERE id IN ($topuidlist) AND birthday<>'0000-00-00' AND heigh>0 AND flag=1 AND dataflag=1 ".$TOP_SQL.$agentSQL." LIMIT 10");
		$total = $db->num_rows($rt);
		if ($total > 0) {
			while($tmprows = $db->fetch_array($rt,'name')){$newrows[]=$tmprows;}
			shuffle($newrows);
			foreach ($newrows as $rows){echo rows_ulist2($rows,'top',$toptime2);}
		}
	}
    ?>
    <!--topu end-->
	<?php if($ZEAI_totalP>0){echo Zeai_ajax_list_fn($ZEAI_totalP,$p,2);}else{echo $nodatatips;}?>
</div>
<script>var scs='<?php echo trimhtml($cs); ?>';</script>
<?php if ($ZEAI_total > $_ZEAI['pagesize']){?>
<div class="blankbottom"></div>
<script>
var ZEAI_totalP = parseInt(<?php echo $ZEAI_totalP; ?>);
var postjson = {submitok:'ZEAI_list',ZEAI_totalP:ZEAI_totalP};
if(!zeai.empty(scs))Object.assign(postjson,tojson(scs.split('&')));
zeaiOnscroll_json={url:MHOST+'/index'+zeai.extname,data:postjson};
<?php echo(ifint($cook_uid))?'var iflogin=true;':'var iflogin=false;';?>
</script>
<!--游弹-->
<?php if(!ifint($cook_uid)){?>
<div id="index_bounce_box" class="bouncelogin">
    <em><img src="<?php echo RES;?>photo_m.jpg?<?php echo $_ZEAI['cache_str'];?>"></em>
	<h1>注册/登录 查看更多会员<br>缘分就在一瞬间，赶快去登录！</h1>
	<a class="btn size4 zeaibg W80_ yuan" href="<?php echo HOST;?>/m/login.php"><font>去注册/登录</font><span class="zeaicolor">私密</span></a>
    <a class="closediv" href="javascript:index_divclose.click();">暂不登录</a>
</div>
<?php }}
if ($ZEAI_total > 0){?>
<a href="javascript:zeai.mask({son:showtype_box,maskcls:'mask_TRnav'});" id="showtype" class="btmKefuBtn"><?php echo $showstr;?></a>
<div id="showtype_box">
    <a<?php echo ($showtype==1)?' class="ed"':'';?>><?php echo $showstr1;?></a>
    <a<?php echo ($showtype==2)?' class="ed"':'';?>><?php echo $showstr2;?></a>
    <a<?php echo ($showtype==3)?' class="ed"':'';?>><?php echo $showstr3;?></a>
</div>
<?php }?>
<div id="backtop"><a id="btmTopBtn"><i class="ico">&#xe60c;</i>顶部</a></div>
<?php
function getTP($TJ,$moretb=false) {
	global $_ZEAI,$db;
	if($moretb){
		$rt = $db->query("SELECT COUNT(*) FROM (".$TJ.") ZEAI__cn_SQL");$row = $db->fetch_array($rt,'num');
	}else{
		$rt = $db->query("SELECT COUNT(*) FROM (SELECT id FROM ".__TBL_USER__." WHERE ".$TJ." LIMIT ".$_ZEAI['limit'].") ZEAI__cn_SQL");$row = $db->fetch_array($rt,'num');
	}
	$total=$row[0];
	return array($total,ceil($total/$_ZEAI['pagesize']));
}
//蹦
$bounce=json_decode($_ZEAI['bounce'],true);
if($bounce['flag']['indexgg'] == 1){
	$bouncev = '';
	$bounceTip = 'cook_index_bounce'.YmdHis(ADDTIME,'d');
	if($_COOKIE[$bounceTip] != 'indexgg'){
		$bouncev ='indexgg';
		$picurl  = UP.$bounce['indexgg_picurl'];
		$url     = $bounce['indexgg_url'];
	}
	if(!empty($bouncev)){
		if($_COOKIE[$bounceTip] != $bouncev){
			setcookie($bounceTip,$bouncev,null,"/",$_ZEAI['CookDomain']);
			?>
			<style>.div_pic img{width:100%;display:block;margin:0 auto}</style>
            <div id="index_bounce_box2" class="bounce_box bounce"><img src="<?php echo $picurl;?>" onClick="zeai.openurl('<?php echo $url;?>');"></div>
			<script>var index_divclose;setTimeout(function(){index_divclose=ZeaiM.div_pic({obj:index_bounce_box2,w:32,h:36});},1500);</script>
			<?php
		}
	}
}
$TRnav_btn = 'hide';
require_once ZEAI.'m/TRnav.php';
require_once ZEAI.'m/bottom2.php';
function mate_echo($row,$kind='') {
	global $_ZEAI;
	if(empty($_ZEAI['mate_diy']))return '';
	$mate_diy = explode(',',$_ZEAI['mate_diy']);
	$mate_age1      = intval($row['mate_age1']);
	$mate_age2      = intval($row['mate_age2']);
	$mate_heigh1    = intval($row['mate_heigh1']);
	$mate_heigh2    = intval($row['mate_heigh2']);
	$mate_pay       = $row['mate_pay'];
	$mate_edu       = $row['mate_edu'];
	$mate_areaid    = $row['mate_areaid'];
	$mate_areatitle = $row['mate_areatitle'];$mate_areatitle=str_replace(" ","",$mate_areatitle);
	$mate_love      = $row['mate_love'];
	$mate_car       = $row['mate_car'];
	$mate_house     = $row['mate_house'];
	$mate_weigh1      = intval($row['mate_weigh1']);
	$mate_weigh2      = intval($row['mate_weigh2']);
	$mate_job         = $row['mate_job'];
	$mate_child       = $row['mate_child'];
	$mate_marrytime   = $row['mate_marrytime'];
	$mate_companykind = $row['mate_companykind'];
	$mate_smoking     = $row['mate_smoking'];
	$mate_drink       = $row['mate_drink'];
	$mate_areaid2     = $row['mate_areaid2'];
	$mate_areatitle2  = $row['mate_areatitle2'];$mate_areatitle2=str_replace(" ","",$mate_areatitle2);
	$mate_other       = dataIO($row['mate_other'],'out');
	$ifmate = ( !empty($mate_age1) || !empty($mate_age2) || !empty($mate_heigh1) || !empty($mate_heigh2) || !empty($mate_pay) || !empty($mate_edu) || !empty($mate_areaid) || !empty($mate_areatitle) || !empty($mate_love) || !empty($mate_house) || !empty($mate_job) || !empty($mate_child) || !empty($mate_marrytime) || !empty($mate_companykind) || !empty($mate_smoking) || !empty($mate_drink) || !empty($mate_areaid2)  || !empty($mate_areatitle2) || !empty($mate_other)  )?true:false;
	if($ifmate){
		$mate_age       = $mate_age1.','.$mate_age2;
		$mate_age_str   = mateset_out($mate_age1,$mate_age2,'岁');
		$mate_age_str = str_replace("不限","",$mate_age_str);
		$mate_heigh     = $mate_heigh1.','.$mate_heigh2;
		$mate_heigh_str = mateset_out($mate_heigh1,$mate_heigh2,'cm');
		$mate_heigh_str = str_replace("不限","",$mate_heigh_str);
		$mate_weigh     = $mate_weigh1.','.$mate_weigh2;
		$mate_weigh_str = mateset_out($mate_weigh1,$mate_weigh2,'kg');
		$mate_weigh_str = str_replace("不限","",$mate_weigh_str);
		$mate_areaid_str  = (!empty($mate_areatitle))?$mate_areatitle:'';
		$mate_areaid2_str = (!empty($mate_areatitle2))?$mate_areatitle2:'';
		$mate_pay_str   = udata('pay',$mate_pay);
		$mate_edu_str   = udata('edu',$mate_edu);
		$mate_love_str  = udata('love',$mate_love);
		$mate_car_str   = udata('car',$mate_car);
		$mate_house_str = udata('house',$mate_house);
		$mate_job_str         = udata('job',$mate_job);
		$mate_child_str       = udata('child',$mate_child);
		$mate_marrytime_str   = udata('marrytime',$mate_marrytime);
		$mate_companykind_str = udata('companykind',$mate_companykind);
		$mate_smoking_str     = udata('smoking',$mate_smoking);
		$mate_drink_str       = udata('drink',$mate_drink);
		$mate_li_out='';
		if (count($mate_diy) >= 1 && is_array($mate_diy)){
			foreach ($mate_diy as $k=>$V) {
				$ext = mate_diy_par($V,'ext');
				$tmpD = 'mate_'.$V;
				$tmpS = 'mate_'.$V.'_str';
				$mate_data = $$tmpD;
				$mate_str  = $$tmpS;
				if(!empty($mate_data) && $mate_data!='0,0'){
					switch ($ext) {
						case 'checkbox':
							$mate_str_=explode(',',$mate_str);
							$mate_strN=count($mate_str_);
							if($mate_strN>1){
								$matesonli='';
								foreach ($mate_str_ as $ks=>$Vs) {$matesonli.='【'.$Vs.'】';}
								$mate_str = $matesonli;
							}
						break;
						default:break;
					}
					if($kind=='text'){
						$mate_li_out.=$mate_str.'，';
					}elseif($kind=='li'){
						if(!empty($mate_str))$mate_li_out.='<li>'.$mate_str.'</li>';
					}else{
						$mate_li_out.='<li><font>'.mate_diy_par($V).'：</font>'.$mate_str.'</li>';
					}
				}
			}
			if($kind=='text'){
				$mate_li_out = rtrim($mate_li_out,'，');
				$mate_li_out = str_replace("不限","",$mate_li_out);
				$mate_li_out .= (!empty($mate_other))?'，其他要求：'.$mate_other:'';
			}elseif($kind=='li'){
				$mate_li_out .= (!empty($mate_other))?'<li>'.$mate_other.'</li>':'';
			}else{
				$mate_li_out .= (!empty($mate_other))?'<li><font>其他要求：</font>'.$mate_other.'</li>':'';
			}
		}
	}
	return $mate_li_out;
}
ob_end_flush();
?>